﻿
namespace Service
{
    using Data.Repository;
	using System.Collections.Generic;

    public class UserSessionService : IUserSessionService
    {
        private IUserSessionRepository _userSessionRepository;

        #region IUserSessionService Members

        /// <summary>
        /// create new UserSession
        /// </summary>
        /// <param name="theNewUserSession">the new UserSession instance</param>
        /// <returns>the new UserSession's ID</returns>
        public int CreateNewUserSession(Data.Entity.UserSession theNewUserSession)
        {
            if (theNewUserSession == null)
            {
                return 0;
            }

            if (_userSessionRepository == null)
            {
                _userSessionRepository = new UserSessionRepository();
            }

            return _userSessionRepository.CreateNewUserSession(theNewUserSession);
        }

        #endregion
    }

}
